<?php

require ("RequestHandler.php");
class CheckRequestHandler extends RequestHandler {
	
	function __construct() {
		$this->CheckRequestHandler();
	}
	
	function CheckRequestHandler() {
		$this->setGateURL("http://mch.tenpay.com/cgi-bin/mchdown_real_new.cgi");	
	}

	function init() {
		
	}

	function createSign() {
	
		$paraKeys = array("spid", "trans_time", "stamp", "cft_signtype", "mchtype");
			

		$signPars = "";
		foreach($paraKeys as $k)
		{
			$v = $this->getParameter($k);
			if($v !="")
			{
				$signPars .= $k . "=" . $v . "&";
			}
		}
		
		$signPars .= "key=" . $this->getKey();
		
		
		
		$sign = strtolower(md5($signPars));
		
		$this->setParameter("sign", $sign);
		

		$this->_setDebugInfo($signPars . " => sign:" . $sign);
		
	}

}

?>